package vn.outsource.weather.ui;

import java.util.ArrayList;
import java.util.Arrays;

import com.example.com.outsource.weather.R;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import vn.tdx.androidlibs.ui.BaseFragmentActivity;
import vn.tdx.androidlibs.ui.customeview.NavigationBar.OnNavigationClickListener;

public class AddLocationActivity extends BaseFragmentActivity implements
		OnClickListener {

	private ImageView mimgLeftNavigation;
	private ImageView mimgRighNavigation;
	private ListView mListView;
	private ArrayAdapter<String> adapter;

	private String[] array = { "Ha Noi", "Hai PHong", "Hai Duong", "Hue",
			"Da Nang", "Hai PHong", "Hai Duong", "Hue", "Da Nang", "Hai PHong",
			"Hai Duong", "Hue", "Da Nang", "Hai PHong", "Hai Duong", "Hue",
			"Da Nang" };
	private ArrayList<String> list;

	@Override
	protected void setContentView(Bundle bundle) {
		setContentView(R.layout.activity_addlocation);
	}

	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);

		mimgLeftNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_left);
		mimgRighNavigation = (ImageView) findViewById(R.id.cv_navigation_bar_img_right);
		mimgRighNavigation.setImageResource(R.drawable.btn_add_highlight);
		mimgLeftNavigation.setImageResource(R.drawable.btn_back);
		mimgLeftNavigation.setOnClickListener(this);
		mimgRighNavigation.setOnClickListener(this);
		
		mimgRighNavigation.setVisibility(View.INVISIBLE);

		mListView = (ListView) findViewById(R.id.activity_location_list);

		list = new ArrayList<String>(Arrays.asList(array));
		adapter = new ArrayAdapter<String>(this,
				R.layout.list_item_addlocation, R.id.text, list);
		mListView.setAdapter(adapter);
	}

	@Override
	protected boolean isNavigationEnable() {
		return false;
	}

	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.cv_navigation_bar_img_left)
			finish();
	}

}
